<%--
  Created by IntelliJ IDEA.
  User: wen
  Date: 2018/8/4
  Time: 19:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>注册页面</title>
    <script type="text/javascript" src="/js/jquery-2.1.3.min.js"></script>
    <script type="text/javascript">
        function check_register(){
            var name = $("#r_username").val();
            var pass = $("#r_password").val();
            var phone = $("#r_phone").val();
            var question = $("#r_question").val();
            var answer = $("#r_answer").val();
            $.ajax({
                type: "POST",
                url: "/user/register.do",
                data: {username:name,password:pass,phone:phone,question:question,answer:answer},
                success: function (data) {
                    if (data.status == 0) {
                        alert(data.data);
                    }
                    else {
                        alert(data.msg);
                    }
                }
            })
        }
    </script>
    <style>
        /*设置所的属性*/
        * {
            margin: 0px;
            padding: 0px;
            box-sizing: border-box;
        }
        /*设置body的css，设置body的背景及no-repeat 的意思是背景图像将仅显示一次*/
        body {
            background: url("../img/myxx.jpg") no-repeat center;
            padding: 25px;   /*内边距*/
        }
        .rg_layout{
            /*设置div大小*/
            width: 900px;
            height: 430px;
            /*边框的大小及填充颜色*/
            border: 8px solid lavenderblush;
            /*div背景颜色*/
            background-color:antiquewhite;
            /*让div水平居中*/
            margin: auto;
            /*外边距离头距离*/
            margin-top: 20px;
            /*透明度*/
            opacity: 0.8;
        }
        .rg_left{
            /*border: 1px solid red;*/
            /*左边的div属性*/
            float: left;
            /*外边距*/
            margin: 15px;
        }
        .rg_left > p:first-child{
            /*设置此div中的第一个p元素样式*/
            color:#FFD026;
            font-size: 20px;
        }
        /*设置此div中最后一个p子元素属性*/
        .rg_left > p:last-child{
            color:#A6A6A6;
            font-size: 20px;

        }

        /*设置此元素的属性*/
        .rg_center{
            float: left;
            /* border: 1px solid red;*/
            margin: 8px;
            margin-top: 30px;
        }
        /*设置此元素的属性（右div）*/
        .rg_right{
            /*border: 1px solid red;*/
            float: right;
            margin: 15px;
        }

        .rg_right > p:first-child{
            font-size: 15px;

        }
        .rg_right p a {
            color:pink;
        }
        /*设置表单中行的属性*/
        .td_left{
            width: 100px;
            text-align: right;
            height: 45px;
        }

        .td_right{
            padding-left: 50px ;
        }

        #username,#password,#checkPassword,#phone,#question,#answer{
            width: 251px;
            height: 32px;
            border: 1px solid #A6A6A6 ;
            /*设置边框圆角*/
            border-radius: 5px;
            /*内边距*/
            padding-left: 10px;
        }
        #checkcode{
            width: 110px;
        }

        #img_check{
            height: 32px;
            /*锤子居中*/
            vertical-align: middle;
        }

        #btn_sub{
            width: 150px;
            height: 40px;
            background-color: #FFD026;
            border: 1px solid #FFD026 ;
        }

    </style>
</head>
<body>
<div class="rg_layout">
    <div class="rg_left">
        <P>新用户注册</P>
        <p>USER REGISTER</P>
    </div>

    <div class="rg_center">
        <div class="rg_form">
            <form>
                <table align="center">
                    <tr>
                        <td class="td_left"><label for="username">用户名</label></td>
                        <td class="td_right"><input type="text" name="username" id="username" placeholder="请输入用户名"></td>
                    </tr>
                    <tr>
                        <td class="td_left"><label for="password">密码</label></td>
                        <td class="td_right"><input type="password" name="password" id="password" placeholder="请输入密码"></td>
                    </tr>
                    <tr>
                        <td class="td_left"><label for="checkPassword">确认密码</label></td>
                        <td class="td_right"><input type="text" name="checkPassword" id="checkPassword" placeholder="请确认密码"></td>
                    </tr>
                    <tr>
                        <td class="td_left"><label for="phone">手机号</label></td>
                        <td class="td_right"><input type="tel" id="phone" name="phone" placeholder="请输入手机号"></td>
                    </tr>
                    <tr>
                        <td class="td_left"><label for="question">找回密码问题</label></td>
                        <td class="td_right"><input type="text" id="question" name="question" placeholder="请输入问题"></td>
                    </tr>

                    <tr>
                        <td class="td_left"><label for="answer">问题答案</label></td>
                        <td class="td_right"><input type="text" id="answer" name="answer" placeholder="请输入答案">
                        </td>
                    </tr>

                    <tr>
                        <td colspan="2" align="center"><input type="submit" id="btn_sub" value="注册">
                            <p>已有账号?<a href="/index.jsp" style="color: red">立即登录</a></p></td>

                    </tr>

                </table>
            </form>
        </div>

    </div>
    <div class="rg_right">
        <p>已有账号?<a href="/index.jsp">立即登录</a></p>
    </div>
</div>
</body>
</html>
